package com.codef.sharp.common.security;

import com.codef.sharp.common.security.bo.UserInfoInTokenBO;

/**
 * @author zhanrf
 * @date 2022/1/25 22:04
 */
public class SecurityContext {
	/** The request holder. */
	private static final ThreadLocal<UserInfoInTokenBO> USER_INFO = new ThreadLocal<>();

	public static UserInfoInTokenBO getUser() {
		return USER_INFO.get();
	}

	public static void setUser(UserInfoInTokenBO userInfo) {
		USER_INFO.set(userInfo);
	}

	public static void clear() {
		USER_INFO.remove();
	}
}
